<template>
	<view>
		<view>
			<button @click="callsetstorage()">console.log</button>
			<button @click="callGetStorage()">console.debug</button>
			<button @click="callStoinfo()">console.info</button>
			<button @click="onwarn()" type="warn" >console.warn</button>
			<button @click="onerror()" type="warn">console.error</button>
		</view>
	</view>
</template>

<script>


	export default {
		data() {
			return {
				
			}
		},
		methods: {
			onfuncall(){
				name=uni.getStorageSync("username");
				pwd="ssss";
			},
			callsetstorage(){
				console.log("call--> username ");
				uni.setStorage({
					key:"username",
					data:"hhhh",
					success(){
						console.log("存储username成功回调");
					},
					fail(){
						console.error("存储username失败回调")
					},complete(){
						console.log("做完了");
					}
					
				})
			},
			callGetStorage(){
				uni.getStorage({
					key:"username",
					success:function(result){
						console.log("获取本地缓存成功"+result.data);
					},
					fail:function(result){
						console.error("获取本地缓存失败"+JSON.stringify(e));
						console.error("获取本地缓存失败"+e.errMsg);
					}
					
				})
			},
			callStoinfo(){
				console.log("callSto-->");
				uni.getStorageInfo({
					success:function(result){
						console.log(""+JSON.stringify(result));
						console.log(""+result.currentSize);
						console.log(""+result.keys);
						
						
					}
				})
					
				
			},
			callremove(){
				
			}
			
		}
	}
</script>

<style>

</style>
